//LuoguUid:397712
//UserName:dingyibo

#include <bits/stdc++.h>

#define MAX_N 100050
#define INF 2147483647

using namespace std;

int n;
long long a[MAX_N];
/*
Trash:

int ans = INF;

bool flag[MAX_N];
bool attacked[MAX_N];


int dp[2];

void DP( int i )
{
    int j;

    if(i == n+1)
    {
        bool tag = true;
        for(j=1;j<=n;++j)
        {
            if(flag[j] == false && attacked[j] == false)
            {
                tag = false;
                break;
            }
        }
        if(tag == true)
        {
            int t_ans = 0;
            for(j=1;j<=n;++j)
            {
                if(flag[j] == false)
                    ++t_ans;
            }
            ans = min(t_ans, ans);
        }        
        return ;
    }

    for(j=1;j<=n;++j)
    {
        if(i == j)
            continue;
        if(flag[j] == true || attacked[i] == true || flag[i] == true)
            continue;
        if(a[i] > a[j])
        {
            flag[j] = true;
            attacked[i] = true;
            DP( i+1 );
            flag[j] = false;
            attacked[i] = false;
        }
        else
        {
            attacked[i] = true;
            DP( i+1 );
            attacked[i] = false;
            //DP( i+1 );
        }
    }
    return ;
}
*/
long long cnt[MAX_N];
long long att_cnt[MAX_N];
long long NeXT[MAX_N];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    //Greedy but not always right:
    int i, j;
    long long ans_2 = 0;
    cin>>n;

    for(i=1;i<=n;++i)
    {
        cin>>a[i];
        ++ans_2;
        att_cnt[a[i]] ++;
        cnt[a[i]] ++;
    }
    sort(a+1, a+1+n);
    //DP(1);

    for(i=2;i<=n;++i)
    {
        if(a[i-1] != a[i])
            NeXT[a[i-1]] = a[i];
    }
    for(i=2;i<=n;++i)
    {
        if(cnt[a[i-1]] != 0 && att_cnt[NeXT[a[i-1]]] != 0)
        {
            cnt[a[i-1]] --;
            -- ans_2;
            att_cnt[NeXT[a[i-1]]] --;
        }
    }
    cout<<ans_2<<'\n';

    return 0;
}